<?php
header("content-type:text/html; charset=utf-8");
   /* define('NAME','朋友');
    function fun ($name=NAME){
    echo '你好！'.$name, '<br />';
    }
fun();*/
/*function fun($name,$age='未知',$add='地址不详'){
    echo'姓名：'.$name.'<br />';
    echo'年龄：'.$age. '<br />';
    echo'地址：'.$add. '<br />';
}
    fun('李白',20,'北京');
    fun('杜甫',22);
    fun('白居易');*/
    /*function fun(){
        $n=func_num_args();
        $array=func_get_args();
        echo'参数个数是：'.$n,'<br>';
        var_dump($array);
        echo'<br />';
    }
fun(10,32,12,54);
fun(1,2,6,4,786,4);
fun(89)*/
   /* function fun($num1,$num2){
        $num=$num1+$num2;
        echo $num;
    }
    fun(23,78)*/
/*function fun1($args){
    $args='测试中。。。。';
}
$array=array('tom','berry');
fun1($array);
var_dump($array);*/

        /*function fun2(&$args){
            $args='测试中、、、、';
        }
    $array=array('tom','berry');
    fun2($array);
    var_dump($array);*/


//function fun($name='朋友'){
  //  echo '你好！'.$name,'<br>';
//}
//fun('libai');
//fun();

      /*  function mymax($num1,$num2){
            if($num1>$num2);
                return $num1;
                return $num2;
        }
echo mymax(10,20);*/


/*$_GET['num1']=10;
function fun1() {
    echo $_GET['num1']+20,'<br>';
}
fun1();

$num2=100;
function fun2(){
    echo $GLOBALS['num2']+20,'<br>';
}
fun2();

$num3=10;
function fun3(){
    global $num3;
    echo $num3+56,'<br>';
    unset($num3);
}
fun3();
echo $num3;*/

/*function fun (){
    static $num=10;
}
function fun2(){
    static $num=20;
    echo $num;
}
fun();
fun2();*/
        /*function fun1(){
            $num=10;
            $num++;
            echo $num,'<br>';
        }
fun1();
fun1();
fun1();*/

/*function  fun2 (){
    static $num=10;
    $num++;
    echo $num,'<br>';
}
fun2();
fun2();
fun2();
fun2();*/



    /*function fun ($n){
        if($n==1);
        return 1;
        return $n+fun($n-1);

    }
echo '从1加到100的和是：'.fun(100);*/


/*$num=10;
function()use($num){
    echo $num;
};
$fun();*/

$num=10;
function mayfun(){
    $num=20;
    $fun=function ()use($num) {
        echo $num;
    };
    $fun();
}
mayfun();

?>